package com.hashbee.user.service.impl;

import com.hashbee.user.dao.AccountMapper;
import com.hashbee.user.domain.Account;
import com.hashbee.user.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;


@Service("accountService")
public class AccountServceImpl implements AccountService {
    @Autowired
    private AccountMapper accountMapper;

    @Override
    @Transactional(transactionManager = "hashbeeTxMgr")
    public  void  saveAccount(String account){
        Account acct=new Account();
        acct.setAccount(account);
        acct.setUserId(UUID.randomUUID().toString());
        acct.setAccountType("web");
        acct.setPassword("123");
        acct.setSalt("test");
        accountMapper.insert(acct);
    }
}
